<template>
  <div>
    <div>这是总数{{showSum}}</div>
    <div>这是总数2:{{sum2}}</div>
    <div>这是总数3:{{sum}}</div>
    <div>这是状态4:{{status.error}}</div>
    <div>这是状态5:{{getSum}}</div>
    <div>这是状态6:{{$store.state.count.myCount }}</div>
    <div>这是状态7:{{getCount }}</div>
    <div>这是状态8:{{allCount.first }}</div>
    <Ch1></Ch1>
    <Ch2></Ch2>
  </div>
</template>
<script>
import Ch1 from './children1.vue'
import Ch2 from './children2.vue'
import { mapState, mapGetters } from 'vuex'
export default {
  components: {
    Ch1, Ch2
  },
  data () {
    return {
      sum2: this.$store.state.sum
    }
  },
  mounted () {

  },
  computed: {
    showSum () {
      return this.$store.state.sum
    },
    ...mapState(['sum', 'status', 'myCount']),
    ...mapGetters(['getSum', 'getCount', 'allCount'])
  },
  methods: {
  }
}
</script>

<style scoped>
#container {
  padding: 0px;
  margin: 0px;
  width: 100%;
  height: 800px;
}
</style>
